﻿Imports System.Data
Imports System.Data.SqlClient
Imports CondorTravel.BE
Imports CondorTravelUTIL.DL



Public Class TipoServicioDALC


    Public Function ListarTipoServicio() As List(Of TipoServicioBE)

        Dim sqlTipoServicioListar As String
        Dim listTipoServicioBE As List(Of TipoServicioBE) = Nothing
        Dim objUnidadBE As TipoServicioBE = Nothing
        Dim ds As DataSet
        Dim dt As DataTable

        Try

            sqlTipoServicioListar = "SP_TipoServicioList"

            Dim oDatos As New AccesoDatos()
            Dim bExito As Boolean
            Dim sMensaje As String = String.Empty
            Dim i As Integer = 0

            ds = oDatos.DevuelveDataSet(sqlTipoServicioListar, bExito, sMensaje, Nothing)
            dt = ds.Tables(0)


            listTipoServicioBE = New List(Of TipoServicioBE)()

            If dt.Rows.Count > 0 Then

                While i < dt.Rows.Count
                    objUnidadBE = New TipoServicioBE()
                    objUnidadBE.Codigo = CType(dt.Rows(i).ItemArray(0).ToString, Integer)
                    objUnidadBE.Nombre = dt.Rows(i).ItemArray(1).ToString
                    i = i + 1

                    listTipoServicioBE.Add(objUnidadBE)
                End While
            End If

        Catch ex As Exception
            Throw
        End Try

        Return listTipoServicioBE

    End Function


End Class
